﻿package core.ui.controls
{
    import flash.display.*;
    import flash.filters.*;

    public class FloatBox extends Sprite
    {
        var tl:Bitmap;
        var tm:Bitmap;
        var tr:Bitmap;
        var ml:Bitmap;
        var mm:Bitmap;
        var mr:Bitmap;
        var bl:Bitmap;
        var bm:Bitmap;
        var br:Bitmap;

        public function FloatBox(param1:int, param2:int, param3:Boolean = true)
        {
            if (param3)
            {
                this.filters = [new DropShadowFilter(0, 45, 0, 0.3, 10, 10, 1, 3, false)];
            }
            var _loc_4:* = new BoxBg();
            this.tl = new Bitmap(UI.GetPart(_loc_4, 0, 18, 24, 40));
            addChild(this.tl);
            this.tm = new Bitmap(UI.GetPart(_loc_4, 24, 18, 2, 40));
            addChild(this.tm);
            this.tr = new Bitmap(UI.GetPart(_loc_4, 26, 18, 24, 40));
            addChild(this.tr);
            this.ml = new Bitmap(UI.GetPart(_loc_4, 0, 55, 24, 2));
            addChild(this.ml);
            this.mm = new Bitmap(UI.GetPart(_loc_4, 24, 55, 2, 2));
            addChild(this.mm);
            this.mr = new Bitmap(UI.GetPart(_loc_4, 26, 55, 24, 2));
            addChild(this.mr);
            this.bl = new Bitmap(UI.GetPart(_loc_4, 0, 57, 24, 10));
            addChild(this.bl);
            this.bm = new Bitmap(UI.GetPart(_loc_4, 24, 57, 2, 10));
            addChild(this.bm);
            this.br = new Bitmap(UI.GetPart(_loc_4, 26, 57, 24, 10));
            addChild(this.br);
            _loc_4.dispose();
            _loc_4 = null;
            this.Resize(param1, param2);
            return;
        }// end function

        public function Resize(bm:int, bm:int) : void
        {
            if (bm < 50)
            {
                bm = 50;
            }
            if (bm < 122)
            {
                bm = 122;
            }
            var _loc_3:* = bm - 48;
            this.bm.width = bm - 48;
            var _loc_3:* = _loc_3;
            this.mm.width = _loc_3;
            this.tm.width = _loc_3;
            var _loc_3:* = bm - 50;
            this.mr.height = bm - 50;
            var _loc_3:* = _loc_3;
            this.mm.height = _loc_3;
            this.ml.height = _loc_3;
            var _loc_3:int = 24;
            this.bm.x = 24;
            var _loc_3:* = _loc_3;
            this.mm.x = _loc_3;
            this.tm.x = _loc_3;
            var _loc_3:* = this.tm.width + 24;
            this.br.x = this.tm.width + 24;
            var _loc_3:* = _loc_3;
            this.mr.x = _loc_3;
            this.tr.x = _loc_3;
            var _loc_3:int = 40;
            this.mr.y = 40;
            var _loc_3:* = _loc_3;
            this.mm.y = _loc_3;
            this.ml.y = _loc_3;
            var _loc_3:* = this.mm.height + 40;
            this.bl.y = this.mm.height + 40;
            var _loc_3:* = _loc_3;
            this.bm.y = _loc_3;
            this.br.y = _loc_3;
            return;
        }// end function

    }
}
